//FYI: https://github.com/Tencent/puerts/blob/master/doc/unity/manual.md

import { FairyEditor } from 'csharp';
import { SpawnCode } from './CodeSpawner';

function onPublish(handler: FairyEditor.PublishHandler) {
    if (!handler.genCode) return;
    handler.genCode = false; //prevent default output

    SpawnCode(handler); //do it myself
}

function onDestroy() {
    //do cleanup here
}

export { onPublish, onDestroy };